Optimal. Leaf size=69 \[ \frac{3 i a^3 \log (\sin (c+d x))}{d}+\frac{i a^3 \log (\cos (c+d x))}{d}-\frac{\cot (c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{d}-4 a^3 x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.115582, antiderivative size = 69, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3553, 3589, 3475, 3531} \[ \frac{3 i a^3 \log (\sin (c+d x))}{d}+\frac{i a^3 \log (\cos (c+d x))}{d}-\frac{\cot (c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{d}-4 a^3 x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3553
Rule 3589
Rule 3475
Rule 3531
Rubi steps
\begin{align*} \int \cot ^2(c+d x) (a+i a \tan (c+d x))^3 \, dx &=-\frac{\cot (c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{d}-\int \cot (c+d x) (a+i a \tan (c+d x)) \left (-3 i a^2+a^2 \tan (c+d x)\right ) \, dx\\ &=-\frac{\cot (c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{d}-\left (i a^3\right ) \int \tan (c+d x) \, dx-\int \cot (c+d x) \left (-3 i a^3+4 a^3 \tan (c+d x)\right ) \, dx\\ &=-4 a^3 x+\frac{i a^3 \log (\cos (c+d x))}{d}-\frac{\cot (c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{d}+\left (3 i a^3\right ) \int \cot (c+d x) \, dx\\ &=-4 a^3 x+\frac{i a^3 \log (\cos (c+d x))}{d}+\frac{3 i a^3 \log (\sin (c+d x))}{d}-\frac{\cot (c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{d}\\ \end{align*}
Mathematica [B] time = 1.5393, size = 144, normalized size = 2.09 \[ \frac{a^3 \csc \left (\frac{c}{2}\right ) \sec \left (\frac{c}{2}\right ) \csc (c+d x) \left (14 d x \cos (2 c+d x)+12 \sin (c) \sin (c+d x) \tan ^{-1}(\tan (4 c+d x))-i \cos (2 c+d x) \log \left (\cos ^2(c+d x)\right )+\cos (d x) \left (3 i \log \left (\sin ^2(c+d x)\right )+i \log \left (\cos ^2(c+d x)\right )-14 d x\right )-3 i \cos (2 c+d x) \log \left (\sin ^2(c+d x)\right )+4 \sin (d x)\right )}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.046, size = 63, normalized size = 0.9 \begin{align*}{\frac{3\,i{a}^{3}\ln \left ( \sin \left ( dx+c \right ) \right ) }{d}}+{\frac{i{a}^{3}\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}-4\,{a}^{3}x-{\frac{{a}^{3}\cot \left ( dx+c \right ) }{d}}-4\,{\frac{{a}^{3}c}{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 2.13866, size = 76, normalized size = 1.1 \begin{align*} -\frac{4 \,{\left (d x + c\right )} a^{3} + 2 i \, a^{3} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 3 i \, a^{3} \log \left (\tan \left (d x + c\right )\right ) + \frac{a^{3}}{\tan \left (d x + c\right )}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.28904, size = 240, normalized size = 3.48 \begin{align*} \frac{-2 i \, a^{3} +{\left (i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} - i \, a^{3}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) +{\left (3 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} - 3 i \, a^{3}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right )}{d e^{\left (2 i \, d x + 2 i \, c\right )} - d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.69711, size = 88, normalized size = 1.28 \begin{align*} - \frac{2 i a^{3} e^{- 2 i c}}{d \left (e^{2 i d x} - e^{- 2 i c}\right )} + \operatorname{RootSum}{\left (z^{2} d^{2} - 4 z i a^{3} d - 3 a^{6}, \left ( i \mapsto i \log{\left (\frac{i i d e^{- 2 i c}}{a^{3}} + e^{2 i d x} + 2 e^{- 2 i c} \right )} \right )\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.4814, size = 165, normalized size = 2.39 \begin{align*} -\frac{16 i \, a^{3} \log \left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + i\right ) - 2 i \, a^{3} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) - 2 i \, a^{3} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) - 6 i \, a^{3} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) - a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - \frac{-6 i \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - a^{3}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]